package com.huo.service;

import com.huo.pojo.Blog;
import com.huo.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    //根据id查询博客
    Blog getBlog(Long id);

    Blog getAndConvert(Long id);

    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    Page<Blog> listBlog(Pageable pageable);

    Page<Blog> listBlog(Long tagId, Pageable pageable);

    //搜索查询
    Page<Blog> listBlog(String query, Pageable pageable);

    //推荐的博客列表
    List<Blog> listRecommendBlogTop(Integer size);

    //按时间归档博客 String对应时间 list对应博客
    Map<String, List<Blog>> archiveBlog();

    //查找对应年份对应的博客数量
    Long countBlog();

    //新增博客
    Blog saveBlog(Blog blog);

    //修改博客 先根据id查询出要修改的blog
    Blog updateBlog(Long id, Blog blog);

    //删除博客
    void deleteBlog(Long id);
}
